from django.contrib import admin
from .models import Note


# 导入导出
from import_export import resources

from import_export.admin import ImportExportModelAdmin
class NoteResource(resources.ModelResource):
    class Meta:
        model = Note

@admin.register(Note)
class NoteAdmin(ImportExportModelAdmin):
    list_display = [ field.name for field in Note._meta.fields ]
    ordering = ['-id']
    resource_class = NoteResource
    search_fields = list_display
